﻿@Master['Master'] 
@Section['Content']
<script type="text/javascript">
jQuery(document).bind("ready", function() {
     jQuery('#logcontent').logViewer({logUrl: '/logs/livelog.html', refreshtimeout: '1000'});
});
get_filesize("/logs/livelog.html", function(size) {
    console.debug("The size of log is: " + size + " bytes.");
});
	$("textarea").on("keypress", "input", function(event){
   // i is current input
  if(event.keyCode  === 38){ //action == 'up'
  alert("up");
       inp = inputs[i > 0 ? parseInt(i) - 1 : inputs.length - 1];
  }
  if(event.keyCode  === 40){ //action == 'down'
      inp = inputs[i < inputs.length - 1 ? parseInt(i) + 1 : 0];
  }
 // focus on the input
   moveFocusTo(inp);
});
  $(document).ready(function() {
  $('body').on('keydown','#findWord', function(event) {
  if (event.keyCode == 13) {
    console.debug('Enter was pressed');
	findWord(jQuery('#findWord').val());
	$("#findWord").focus();
  }
});
  $(window).on('load resize', function(){
    $('#logcontent').height($(this).height() -200);
	$("#logcontent").scrollTop($("#logcontent")[0].scrollHeight);
    //$('#div').width($(this).width());
});
    nice = $("scroll").niceScroll();
  });
</script>
<div class="container">
	<div class="col-md-3" id="live">
		Live log - @Model.LogSize kb <a href="logs/@Model.LogFile">d/l</a>
	</div>
	<div class="col-md-3 col-md-offset-2">
		<div action="" class="search-form">
			<div class="form-group has-feedback">
				<label for="search" class="sr-only">Search</label>
				<input id="findWord" type="text" class="form-control" name="search" id="search" placeholder="search">
				<span onclick="javascript:findWord(jQuery('#findWord').val())" class="glyphicon glyphicon-search form-control-feedback"></span>
			</div>
		</div>
	</div>
	<textarea class="scroll" id="logcontent" wrap="off" readonly="yes" autocomplete="off"></textarea>
</div>
</div>
<script type="text/javascript" src="/content/js/jquery.logviewer.js"></script>
@EndSection